package com.beep.erp;

import com.beep.erp.common.bean.UpdateBean;
import com.beep.erp.http.HttpExceptionHandle;
import com.beep.erp.http.HttpResultSubscriber;

import rx.Subscriber;

/**
 * Created by jolly on 2018/8/24.
 */

public class MainPresenter extends MainContract.Presenter {
    @Override
    public void onStart() {
        getTabs();
        mView.getDate();
    }

    @Override
    public void getTabs() {
        mView.getTabs();
    }

    @Override
    public void updateVison() {
        mView.showLoading();
        mRxManage.add(mModel.updateVison().subscribe(new HttpResultSubscriber<UpdateBean>() {

            @Override
            public void onNext(UpdateBean updateBean) {
                mView.hideLoading();
                mView.updateVision(updateBean);
            }

            @Override
            public void onError(HttpExceptionHandle.ResponeThrowable e) {
                mView.hideLoading();
                mView.showMessage(e.getMessage());
            }
        }));
    }
}
